package com.fqgj.sentry.controller.antiFraud;

import com.fqgj.sentry.biz.antiFraud.domain.OrderVo;
import com.fqgj.sentry.common.annotations.VisitorAccessible;
import com.fqgj.sentry.common.cache.RequestLocalInfo;
import com.fqgj.sentry.common.response.ApiOutput;
import com.fqgj.sentry.controller.antiFraud.request.AntiRelationQuery;
import com.fqgj.sentry.controller.antiFraud.response.anti.AntiFraudDataUtil;
import com.fqgj.sentry.controller.antiFraud.response.anti.tree.AntiRelationInfo;
import com.fqgj.sentry.controller.antiFraud.response.anti.tree.NodeTreeDataUtil;
import com.fqgj.sentry.controller.antiFraud.response.anti.tree.statistics.NodeStatisticsUtil;
import com.fqgj.sentry.controller.antiFraud.response.anti.tree.statistics.NodeStatisticsVo;
import com.fqgj.sentry.manage.entity.McApplicationEntity;
import com.fqgj.sentry.manage.service.ApplicationService;
import com.fqgj.sentry.policy.client.RiskAntiRelationService;
import com.fqgj.sentry.policy.entity.RmRiskAntiRelationEntity;
import com.fqgj.log.interfaces.Log;
import com.fqgj.log.factory.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/antifraud")
public class OrderRelationController {
    public static final Log LOGGER = LogFactory.getLog(OrderRelationController.class);


    @Autowired
    private RiskAntiRelationService riskAntiRelationService;

    @Autowired
    private NodeTreeDataUtil nodeTreeDataUtil;
    @Autowired
    private ApplicationService applicationService;

    /**
     * 查询列表
     */
    @VisitorAccessible
    @RequestMapping(value = "/order/tree", method = RequestMethod.POST)
    public ApiOutput orderTree(@RequestBody AntiRelationQuery antiRelationQuery) {
       return ApiOutput.success();
    }


    @VisitorAccessible
    @RequestMapping(value = "/order/tree/data", method = RequestMethod.GET)
    public ApiOutput orderTreeList() {

        return new ApiOutput<>();
    }

    /**
     * 查询列表
     */
    @RequestMapping(value = "/order/tree/test", method = RequestMethod.POST)
    public ApiOutput orderTreeTest(@RequestBody AntiRelationQuery antiRelationQuery) {
        OrderVo orderVo = AntiFraudDataUtil.getAntiFraudVo();
        AntiRelationInfo antiRelationInfo = nodeTreeDataUtil.drawAntiRelationInfo(1L, 1L,
                orderVo, antiRelationQuery.getLayer());
        return new ApiOutput<>(antiRelationInfo);
    }


}
